package com.gexiaobao.pigeon.ui.dialog

import android.annotation.SuppressLint
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import androidx.appcompat.widget.AppCompatButton
import androidx.core.view.isVisible
import com.gexiaobao.pigeon.R

/**
 * @Author      : hxw
 * @Date        : 2024/8/1 8:54
 * @Describe    :
 */
class RxDialogGameResultMore(context: Context?) : RxDialog(context!!) {

    private lateinit var tvDialogClose: AppCompatButton
    private lateinit var llHomingPicture: LinearLayout
    private lateinit var llHomingVideo: LinearLayout
    private lateinit var llRecord: LinearLayout

    init {
        initView()
    }

    @SuppressLint("MissingInflatedId")
    private fun initView() {
        val dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_game_result_more_function, null)
        tvDialogClose = dialogView.findViewById(R.id.tvDialogClose)
        llHomingPicture = dialogView.findViewById(R.id.llHomingPicture)
        llHomingVideo = dialogView.findViewById(R.id.llHomingVideo)
        llRecord = dialogView.findViewById(R.id.llRecord)

        tvDialogClose.setOnClickListener {
            dismiss()
        }
        setContentView(dialogView)
    }

    fun setHiddenVideo(isHidden: Boolean) {
        llHomingVideo.isVisible = isHidden
    }

    fun setHiddenPicture(isHidden: Boolean) {
        llHomingPicture.isVisible = isHidden
    }

    fun setPictureListener(listener: View.OnClickListener?) {
        llHomingPicture.setOnClickListener(listener)
    }

    fun setVideoListener(listener: View.OnClickListener?) {
        llHomingVideo.setOnClickListener(listener)
    }

    fun setRecordListener(listener: View.OnClickListener?) {
        llRecord.setOnClickListener(listener)
    }

}